<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>节点管理</title>
</head>

<body>
	<div id="wrap">
		<a href="<?php echo U('admin/Rbac/addNode');?>">添加应用</a>
		<table border="1">
			<tr><td>序号</td><td>结点描述</td><td>名称</td><td>排序</td><td>类型</td><td>管理</td></tr>
			<?php if(is_array($node)): $i = 0; $__LIST__ = $node;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
					<td><?php echo ($vo['id']); ?></td>
					<td><p style="text-indent:<?php echo ($vo['level']*20); ?>px ">·<?php echo ($vo["title"]); ?></p></td>
					<td><?php echo ($vo["name"]); ?></td>
					<td><?php echo ($vo["sort"]); ?></td>
					<td><?php if($vo['level'] == 1): ?>项目<?php elseif($vo['level'] == 2): ?><div style="color:green">模块</div><?php else: ?><div style="color:blue">操作</div><?php endif; ?>
					</td>
					<td>
						[<a href="<?php echo U('admin/Rbac/addNode',array('pid'=>$vo['id'],'level'=>2));?>">添加控制器</a>]
						[<a href="">修改</a>]
						[<a href="<?php echo U('admin/Rbac/deleteNode',array('id'=>$vo['id']));?>">删除</a>]
					</td>
					<?php if(is_array($vo["child"])): $i = 0; $__LIST__ = $vo["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$action): $mod = ($i % 2 );++$i;?><dl>
							<dt>
								<strong><?php echo ($action["title"]); ?></strong>
								[<a href="<?php echo U('admin/Rbac/addNode',array('pid'=>$action['id'],'level'=>3));?>">添加方法</a>]
								[<a href="">修改</a>]
								[<a href="">删除</a>]
							</dt>
							<?php if(is_array($action["child"])): $i = 0; $__LIST__ = $action["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$method): $mod = ($i % 2 );++$i;?><dd>
									<span><?php echo ($method["title"]); ?></span>
									[<a href="">修改</a>]
									[<a href="">删除</a>]
								</dd><?php endforeach; endif; else: echo "" ;endif; ?>
						</dl><?php endforeach; endif; else: echo "" ;endif; ?>
				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
		</table>
	</div>
</body>
</html>